package com.zb.vo;

import com.zb.annotation.NumberPattern;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @Author WEN
 * @Date 2024/2/27 0027
 **/
@Data
@ApiModel("品牌商家对象")
public class FactoryVo {
    @ApiModelProperty(value = "品牌商家ID，新增不必传，修改必传")
    private Long id;

//    @ApiModelProperty(value = "工单标识号，唯一性，创建工单时用于工单号标识，一旦创建，不可更改", hidden = true)
//    private String orderIdentifierNo;

    @NotBlank(message = "商家名称不能为空")
    @Length(min = 2, max = 200, message = "商家名称至少输入2个字符，至多允许输入200个字符")
    @ApiModelProperty(value = "商家名称", required = true)
    private String name;

    @NotNull(message = "商家状态不能为空")
    @NumberPattern(regexp = "^(1|2|3|4)$", required = true, message = "商家状态参数不合法")
    @ApiModelProperty(value = "商家状态：1-待审核，2-已审核/使用中，3-已驳回/拒绝，4-已禁用", required = true, example = "2")
    private Integer status;

    @NotBlank(message = "商家地址-省不能为空")
    @Length(max = 50, message = "商家地址-省长度限制50个字符")
    @ApiModelProperty(value = "商家地址-省", required = true)
    private String province;

    @NotBlank(message = "商家地址-市不能为空")
    @Length(max = 50, message = "商家地址-市长度限制50个字符")
    @ApiModelProperty(value = "商家地址-市", required = true)
    private String city;

    @NotBlank(message = "商家地址-县/区不能为空")
    @Length(max = 50, message = "商家地址-县/区长度限制50个字符")
    @ApiModelProperty(value = "商家地址-县/区", required = true)
    private String area;

    @Length(max = 50, message = "商家地址-镇长度限制50个字符")
    @ApiModelProperty(value = "商家地址-镇 ")
    private String town;

    @NotBlank(message = "商家详细地址不能为空")
    @Length(max = 200, message = "商家详细地址长度限制200个字符")
    @ApiModelProperty(value = "商家详细地址", required = true)
    private String address;

    @NotBlank(message = "联系人名称不能为空")
    @Length(max = 100, message = "联系人名称限制100个字符")
    @ApiModelProperty(value = "联系人名称", required = true)
    private String username;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = VerificUtil.REGEX_PHONE, message = "手机号格式错误")
    @ApiModelProperty(value = "手机号", required = true)
    private String phone;

    @ApiModelProperty(value = "品牌商家账号ID", required = true, example = "0")
    private Long accountId;

    @NotBlank(message = "绑定账号不能为空")
    @Pattern(regexp = VerificUtil.REGEX_PHONE, message = "绑定账号(手机号)格式错误")
    @ApiModelProperty(value = "绑定账号(手机号)", required = true)
    private String accountPhone;

    @NotBlank(message = "负责人名称不能为空")
    @Length(max = 100, message = "负责人名称限制100个字符")
    @ApiModelProperty(value = "负责人名称", required = true)
    private String accountName;

    @Valid
    @ApiModelProperty(value = "品牌商家策略对象")
    private FactoryStrategyVo strategy;

    @ApiModelProperty(value = "工单模块结算对象")
    private List<FactoryOrderModuleSettlementVo> moduleSettlements;

    @ApiModelProperty(value = "删除的工单模块结算ID对象")
    private List<Long> delModuleSettlementIds;

}
